<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="utf-8" />
	<title>登录</title>

	<meta name="description" content="User login page" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<link href="../public/css/bootstrap.min.css" rel="stylesheet" />
	<link rel="stylesheet" href="../public/css/font-awesome.min.css" />

	<!--[if IE 7]>
		  <link rel="stylesheet" href="../public/css/font-awesome-ie7.min.css" />
		<![endif]-->

	<!-- page specific plugin styles -->

	<!-- fonts -->

	<!-- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:400,300" /> -->

	<!-- ace styles -->
	<script src="../public/js/jquery-1.10.2.min.js"></script>
	<link rel="stylesheet" href="../public/css/ace.min.css" />
	<link rel="stylesheet" href="../public/css/ace-rtl.min.css" />

	<!--[if lte IE 8]>
		  <link rel="stylesheet" href="../public/css/ace-ie.min.css" />
		<![endif]-->

	<!-- inline styles related to this page -->

	<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->

	<!--[if lt IE 9]>
		<script src="../public/js/html5shiv.js"></script>
		<script src="../public/js/respond.min.js"></script>
		<![endif]-->
</head>

<body class="login-layout">
	<div class="main-container">
		<div class="main-content">
			<div class="row">
				<div class="col-sm-10 col-sm-offset-1">
					<div class="login-container">
						<div class="center">
							<h1>
									<span class="white">企业管理系统</span>
								</h1>
						</div>
						<div class="space-6"></div>
						<div class="position-relative">
							<div id="login-box" class="login-box visible widget-box no-border">
								<div class="widget-body">
									<div class="widget-main">
										<h4 class="header blue lighter bigger">
												<i class="icon-coffee green"></i>
												管理员登录
											</h4>
										<div class="space-6"></div>
										<fieldset>
											<label class="block clearfix">
													<span class="block input-icon input-icon-right">
														<input type="text" class="form-control" name="username" placeholder="请输入账号" />
														<i class="icon-user"></i>
													</span>
												</label>
											<label class="block clearfix">
													<span class="block input-icon input-icon-right">
														<input type="password" class="form-control" name="password" placeholder="请输入密码" />
														<i class="icon-lock"></i>
													</span>
												</label>
											<div class="space"></div>
											<div class="clearfix">
												<label class="inline"><input type="radio" name="utype" value="2" checked="checked">员工</label>
												<label class="inline"><input type="radio" name="utype" value="1">管理员</label>
                        <input type="button" id="login" class="width-35 pull-right btn btn-sm btn-primary" value="登录">
											</div>
											<div class="space-4"></div>
										</fieldset>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript">
		$('#login').click(function() {
			$.post('/login/login', {
				username:$('input[name="username"]').val(),
				password:$('input[name="password"]').val(),
				utype:$('input[name="utype"]:checked').val()
			}, function(data) {
				if(data=='success'){
					location.href='/home';
				}else{
					alert('账号/密码错误，登录失败');
				}
			});
		});
	</script>
</body>

</html>
